<%-- 
    Document   : deleteElection
    Created on : Oct 26, 2012, 3:40:55 PM
   author : Mishal Parmar

--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="entityclasses.election"%>
<%@page import="controllers.viewElection"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head><!--
    <script type="text/javascript">
        
        function chk()
        {
            alert("hi");
            var x=document.getElementById("electid").value;
            alert(x);
            alert("done");
            
            //alert(document.getElementById("electid").value);
            //document.getElementById("eid").value=document.getElementById("electid").value;
            
        }
        
        
    </script>
    -->
    <body>
        <form name="delete" action="deleteElection" method="post">

            <%
        
        viewElection electionview =new viewElection();
       election elect=new election();
        ArrayList array = new ArrayList();  
        Object result = request.getAttribute("viewelection");  

        array = (ArrayList<election>) result;  

        out.println("<h1> Election List </h1> <table border=1>");
        for(int i=0;i<array.size();i++)
         {
            out.println("<tr>");
        elect= (election) array.get(i);
        int id=elect.getElect_id();
        out.println("<td><input type='radio' name='electid' value='"+id+"' id='electid'/></td>");
        out.println("<Td>" +elect.getElect_year());  
        out.println("<Td>" + elect.getCommissioner_id());
        out.println("<td>"+elect.getStart_time());  
        out.println("<td>"+elect.getEnd_time());
        out.println("<td>"+elect.getNominee_start());  
        out.println("<td>"+elect.getNominee_end());
        
        //out.println("<td> <a href='deleteElection'> <input type='button' value='Remove'/></a> </td> ");
        out.println("<tr>");
         }
        out.println("<table>");
       
        %>
        <input type="submit" value="Delete" name="delete">
        
        </form> <!--
        <form name="modify" action="temp" method="post" onsubmit="chk()">
            <input type="hidden" value="mishal" name="eid" id="eid">
            <input type="submit" value="Modify" name="modify">
        </form>
        -->
      
    </body>
</html>
